package com.casstime.ec.cloud.meeting.dao.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@ApiModel(value="com.casstime.ec.cloud.meeting.dao.entity.EntityDepartment")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EntityDepartment implements Serializable {
    @ApiModelProperty(value="id")
    private Integer id;

    @ApiModelProperty(value="departmentName部门名称")
    private String departmentName;

    private static final long serialVersionUID = 1L;

    public enum Column {
        id("id", "id", "INTEGER"),
        departmentName("department_name", "departmentName", "VARCHAR");

        private final String column;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
        }

        public String desc() {
            return this.column + " DESC";
        }

        public String asc() {
            return this.column + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }
    }
}